package com.tedu.egspringbootmvc.common.result;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class JsonResult {
    private Integer status;
    private String msg;
    private Object data;

    public JsonResult(StatusCode status) {
        this.status = status.getStatusCode();
        this.msg = status.getMessage();
    }

    public JsonResult( StatusCode status ,Object data) {
        this(status);
        this.data = data;
    }

    public static JsonResult success(Object data) {
        return new JsonResult(StatusCode.OPERATION_SUCCESS);
    }
}

